<%@page import="javax.swing.text.DateFormatter"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="org.ocpsoft.pretty.time.PrettyTime"%>
<%@ page language="java" isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:directive.include file="/WEB-INF/sitemesh-decorators/include.jsp" />

<script>
function confirmDeleteAttachment(delUrl) {
  if (confirm("Are you sure you want to delete this attachment?")) {
    document.location = delUrl;
  }
}
</script>


<c:forEach items="${attachments }" var="attachment">

	<div class="line" style="width:98%; margin:0px auto; margin-top:7px;margin-bottom:7px;">
		<a href="${pageContext.request.contextPath}/task/attachment/${attachment.id}/download?rk=${attachment.rowkey}" style="color:#219CCB; text-decoration:underline; display:inline;"><img src="${pageContext.request.contextPath}/images/unknown.jpg" align="left" style="margin-right:7px; border:none;" />${attachment.fileName}</a>
	    <span style="font-style:italic; margin-left:5px;">(Upload by: ${attachment.user.username })</span>
	    
	    <span class="tab" style="float: right; z-index: 9;"> 
			<a  href="${pageContext.request.contextPath}/task/attachment/${attachment.id}/download?rk=${attachment.rowkey}">Download</a>
			|
			<a	 class="deleteComment" id="deleteComment" href="javascript:confirmDeleteAttachment('${pageContext.request.contextPath}/task/${task.id }/attachment/${attachment.id}/delete?rk=${attachment.rowkey}')"	onclick=""><img style="margin-top: 6px;" src="${pageContext.request.contextPath}/images/admin-remove.png" alt="delete"></a> 
		</span>
	</div>

</c:forEach>